package mammuthus.web.service;


import mammuthus.client.ConfClient;
import mammuthus.client.ZKClientWrapper;
import net.csdn.common.settings.ImmutableSettings;
import net.csdn.common.settings.Settings;
import org.springframework.stereotype.Service;

/**
 * Created by fengbingjian on 15/3/26 09:51.
 */
@Service
public class ConfClientService {

    private ConfClient confClient;
    public ConfClientService(){
        Settings settings = ImmutableSettings.settingsBuilder().loadFromClasspath("./application.yml").build();

        ZKClientWrapper zkClientWrapper = new ZKClientWrapper(settings);
        confClient = new ConfClient(settings, zkClientWrapper);
    }

    public ConfClient getConfClient() {
        return confClient;
    }
}
